﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///SessionManager 的摘要说明
/// </summary>
public class SessionManager
{
    //这里不怎么懂，什么用法，这是怎么创建类的实例的.....
    /**public class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, 
     * IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback
     * IDictionary是Dictionary的父类，子类的实例可以赋值给父类
     * */
	private static IDictionary<string,IDictionary<string,object>> data = new Dictionary<string,IDictionary<string,object>>();

    public static IDictionary<string,object> GetSession(string sessionId)
    {
        if(data.ContainsKey(sessionId))
        {
            return data[sessionId];
        }
        else
        {
            IDictionary<string,object> session = new Dictionary<string,object>();
            data[sessionId] = session;
            return session;
        }
    }
}